The compounds of the formula (I) was produced by the present inventors, and some of them are known to be capable of improving the liver function as well as preventing and treating diseases caused by immunodeficiency (see Japanese Patent Public Disclosure No. 12141/77 and U.S. Pat. No. 4,092,426). Further studies have shown that these compounds also have anti-ulcer activities that are entirely different pharmacological effects from those to improve liver function and immunological function. The present invention is the result of this unexpected finding plus follow-up studies.